# Base os image
FROM 192.168.176.2/library/centos7-systemd-sshd
MAINTAINER dian "dian@juanpi.com"
LABEL Description="This image is the go &vue devpos  images"  Version="1.0"
#调整时间差
RUN echo "Asia/Shanghai" > /etc/timezone \ && dpkg-reconfigure -f noninteractive tzdata

#安装git && gcc
RUN yum -y install git && yum -y install gcc

#安装go环境
ADD go1.9.linux-amd64.tar /usr/local/
#设置go环境变量
ENV GOPATH /usr/local/go 
ENV GOROOT /data/
ENV GOBIN  /data/bin
ENV PATH  $PATH:/usr/local/go/bin/:$GOBIN

#安装bee工具
RUN go get github.com/beego/bee
RUN ln -s /data/bin/bee /usr/local/bin

#安装nodejs
ADD node-v8.9.1-linux-x64.tar /usr/local/
RUN mv /usr/local/node-v8.9.1-linux-x64/  /usr/local/nodejs

#设置npm node软链
RUN ln -s /usr/local/nodejs/bin/node /usr/local/bin && ln -s /usr/local/nodejs/bin/npm /usr/local/bin

#更换淘宝镜像，安装cnpm
RUN /usr/local/bin/npm config set registry https://registry.npm.taobao.org &&  /usr/local/bin/npm install -g cnpm --registry=https://registry.npm.taobao.org

#设置cnpm 软链
RUN ln -s /usr/local/nodejs/bin/cnpm /usr/local/bin

#安装vue
RUN /usr/local/bin/cnpm install -g vue-cli

#复制control文件
RUN control /data/

CMD ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisord.conf"]